<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ page session="false" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="<c:url value='/resources/css/style.css' />" media="all" />

	<script type="text/javascript">
   
		jQuery(document).ready(function() {						
			$('#loader').hide();
			$('#show_heading').hide();			
			
		});

	</script>

</head>
<body>
<div id="data_content">
<img src="<c:url value='/resources/css/images/loader.gif' />" style="margin-top: 8px; float: left" id="loader" alt="" />
<table style="border: 1px solid; width: 625px;">
 <thead style="background:#181717">
  <tr>
   <th>Thai Name</th>
   <th>Eng Name</th>
   <th>Car Brand</th>
   <th colspan="3"></th>
  </tr>
 </thead>
 <tbody>
 <c:forEach items="${carModels}" var="carModel">
 <c:url var="editCarModel" value="carModels/edit.html?id=${carModel.id}" />
<c:url var="deleteCarModel" value="/carModels/delete.html?id=${carModel.id}" />
  <tr>
   <td><c:out value="${carModel.nameThai}" /></td>
   <td><c:out value="${carModel.nameEng}" /></td>
   <td><c:out value="${carModel.carBrand.nameEng}" /></td>
   <td><a onclick="javascript:getPagePreview('${editCarModel}')">Edit</a></td>
   <td><a href="${deleteCarModel}">Delete</a></td>
  </tr>
 </c:forEach>
 </tbody>
</table>
</div>
 
<c:if test="${empty carModels}">
 There are currently no carModels in the list. <a href="${addCarModel}">Add</a> a Model.
</c:if>
 
</body>
</html>